package com.fenghuajueli.idiomppp.database;

import android.content.Context;

public class IdiomDaoUtils {
    private static IdiomPinManager idiomPinManager;
    private static IdiomShiYiManager idiomShiYiManager;
    private static IdiomXiaoXiaoManager idiomXiaoXiaoManager;
    private static IdiomStoryManager idiomStoryManager;
    public static Context context;

    public static void init(Context context) {
        IdiomDaoUtils.context = context;
    }

    /**
     * 单列模式获取IdiomPinManager对象
     *
     * @return
     */
    public static IdiomPinManager getIdiomPinManager() {
        if (idiomPinManager == null) {
            idiomPinManager = new IdiomPinManager(context);
        }
        return idiomPinManager;
    }


    /**
     * 单列模式获取DuanYuManager对象
     *
     * @return
     */
    public static IdiomShiYiManager getIdiomShiYiManager() {
        if (idiomShiYiManager == null) {
            idiomShiYiManager = new IdiomShiYiManager(context);
        }
        return idiomShiYiManager;
    }

    public static IdiomXiaoXiaoManager getIdiomXiaoXiaoManager() {
        if (idiomXiaoXiaoManager == null) {
            idiomXiaoXiaoManager = new IdiomXiaoXiaoManager(context);
        }
        return idiomXiaoXiaoManager;
    }

    public static IdiomStoryManager getIdiomStoryManager() {
        if (idiomStoryManager == null) {
            idiomStoryManager = new IdiomStoryManager(context);
        }
        return idiomStoryManager;
    }
}
